#set( $page_title = "买单退款" )
<div>
    <div style="font-size: 24px; color: #333333;">买单退款</div>
    <div style="border-top: 1px solid #e7e7e7; margin-top: 20px;"></div>
    <div style="margin-top: 20px;">
                <form action="$!{velocityCommonUtil.getAbsoluteURL()}/payOrderRefund.html" method="get">
                    <span style="color: #747474;">商户名称：</span><input type="text" name="shopName" value="$!{shopName}"> 
                    <span style="color: #747474;">订单号：</span><input type="text" name="toOuterId"  value="$!{toOuterId}"    style="width: 280px;"> 
                    <input type="submit" class="btn   btn-danger"  value="搜索" style="height: 30px; width: 60px;" />
                </form>
    </div>
    <div style="margin-top: 20px;">
        <table class="table" cellPadding="0" cellSpacing="0" style="width: 100%;">
            <thead>
                <tr>
                    <th style="width: 20%;">申请时间</th>
                    <th style="width: 20%;">订单号</th>
                    <th style="width: 10%;">退款金额</th>
                    <th style="width: 10%;">收款商户</th>
                    <th style="width: 10%;">付款用户</th>
                    <th style="width: 15%;">付款方式</th>
                    <th style="width: 8%;">状态</th>
                    <th style="width: 7%;">操作</th>
                </tr>
            </thead>
            
            <tbody  style="font-size: 12px;">
               #foreach ($payOrder in $payOrders)
                <tr>
                    <td style="width: 20%;">$date.format('yyyy-MM-dd HH:mm:ss',$payOrder.createdAt) </td>
                    <td style="width: 20%;">$payOrder.toOuterId</td>
                    <td style="width: 10%;">$price.feng2DotYuan($payOrder.totalPrice)</td>
                    <td style="width: 10%;">$!payOrder.shop.name</td>
                    <td style="width: 10%;">$!payOrder.user.mobile</td>
                    <td style="width: 15%;">$velocityBizUtil.payOrderPayType($!payOrder.payType)</td>
                    <th style="width: 8%;">$velocityBizUtil.payOrderStatus($!payOrder.status)</th>
                    <td style="width: 7%;">#if(${payOrder.status} ==4)<a href="javascript:payOrderRefund('$!{payOrder.id}')"  class="anormalLink"  >退款</a>#end</td>
                </tr>
               #end
            </tbody>
        </table>
        
         <div  align="right">
                $velocityCommonUtil.pageInfo($pageInfo)
         </div>
         
    </div>
</div>
<script type="text/javascript">
function payOrderRefund(payOrderId) {
    YTLib.doAjaxRequest({
        url : "$!{velocityCommonUtil.getAbsoluteURL()}/payOrderRefundUrl",
        data : {payOrderId:payOrderId},
        loading:true
    }, function(res) {
    	if(res.data && res.data.url ){
    	      location.href = res.data.url ;
    	}
    });
}
</script>




